﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using MimiDouban.Player;
using MimiDouban.Abstract;
using doubanloginDll8;
using MimiDouban.Control;
using MimiDouban.Test;
using MimiDouban.SongProvider;
using MimiDouban.Abstract.Beans;
using MimiDouban.UI;
using MimiDouban.UI.HttpInputUI;
using MimiDouban.UI.SkinManager;
using MimiDouban.Extention;
using MimiDouban.LyricsProvider;

namespace MimiDouban
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        /// <summary>
        /// 程序入口函数，主要的对象都在这里生成
        /// </summary>
        public App()
        {
            IMainUI main = new MainWindow();//主界面
            IInputUI hotkeyUi = new HotKeyInputUI();//快捷键输入界面
            IInputUI httpUi = new HttpInputUI();
            IOutputUI tipsUi = new TipsOutputUI((MainWindow)main);
            IOutputUI lyricUi = new Lyric((MainWindow)main);
            MainUIProxy mainStud = new MainUIProxy();//界面代理，所有界面由此代表
            mainStud.addMainUI(main);
            mainStud.addInputUI(hotkeyUi);
            mainStud.addInputUI(httpUi);
            mainStud.addOutputUI(tipsUi);
            mainStud.addOutputUI(lyricUi);

            mainStud.Channels = new DoubanChannel[] {
                new DoubanChannel("0","私人兆赫"),
                new DoubanChannel("-3","红心"),
	            new DoubanChannel("1","华语"),
                new DoubanChannel("4","八零"),
                new DoubanChannel("2","欧美"),
                new DoubanChannel("32","咖啡"),
                new DoubanChannel("9","轻音乐"),
                new DoubanChannel("6","粤语"),
                new DoubanChannel("61","新歌"),
                new DoubanChannel("5","九零"),
                new DoubanChannel("76","小清新"),
                new DoubanChannel("8","民谣"),
                new DoubanChannel("16","R&B"),
                new DoubanChannel("27","古典"),
                new DoubanChannel("20","女声"),
                new DoubanChannel("13","爵士"),
                new DoubanChannel("17","日语"),
                new DoubanChannel("28","动漫"),
                new DoubanChannel("18","汉语"),
                new DoubanChannel("7","摇滚"),
                new DoubanChannel("10","电影原声"),
                new DoubanChannel("3","七零"),
                new DoubanChannel("86","奥运"),
                new DoubanChannel("77","Easy"),
                new DoubanChannel("15","说唱"),
                new DoubanChannel("14","电子"),
                new DoubanChannel("26","豆瓣音乐人"),
                new DoubanChannel("78","91.1"),
                new DoubanChannel("84","迪奥魅惑夏日"),
                new DoubanChannel("83","308选择出色")
            };

            IController controller = new Controller();
            controller.setMainUI(mainStud);
            controller.setPlayer(new AudioPlayer());
            controller.setSongProvider(new DoubanSongProvider());
            controller.setLyricsProvider(new DoubanLyricsProvider());

            controller.start();
        }
    }
}